package leader.action;

import leader.bean.Leader;
import leader.service.LeaderService;
import teacher.bean.Teacher;

import com.opensymphony.xwork2.ActionContext;

public class UpdateDirectInformationAction {
	private String directname;
	private String directmailbox;
	private String directintroduction;
	private String directremarks;
	private String flag;
	public String getDirectname() {
		return directname;
	}

	public void setDirectname(String directname) {
		this.directname = directname;
	}

	public String getDirectmailbox() {
		return directmailbox;
	}

	public void setDirectmailbox(String directmailbox) {
		this.directmailbox = directmailbox;
	}

	public String getDirectintroduction() {
		return directintroduction;
	}

	public void setDirectintroduction(String directintroduction) {
		this.directintroduction = directintroduction;
	}

	public String getDirectremarks() {
		return directremarks;
	}

	public void setDirectremarks(String directremarks) {
		this.directremarks = directremarks;
	}

	public String getFlag() {
		return flag;
	}

	public void setFlag(String flag) {
		this.flag = flag;
	}

	public String execute(){
		flag = "error";
		Teacher lea=(Teacher) ActionContext.getContext().getSession().get("leader");
		Leader leader = new Leader();
		leader.setName(directname);
		leader.setMailbox(directmailbox);
		leader.setIntroduction(directintroduction);
		leader.setRemarks(directremarks);
		LeaderService LS = new LeaderService();
		LS.updateLeader(lea, leader);
		flag = "success";
		return "success";
	}
}
